﻿using Taype.Trading.BTC.MtGoxAPIClient.JSONObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace MtGoxAPIClient_test
{
    
    
    /// <summary>
    ///This is a test class for MtGoxMultiCurrencyTickerItemTest and is intended
    ///to contain all MtGoxMultiCurrencyTickerItemTest Unit Tests
    ///</summary>
    [TestClass()]
    public class MtGoxMultiCurrencyTickerItemTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for MtGoxMultiCurrencyTickerItem Constructor
        ///</summary>
        [TestMethod()]
        public void MtGoxMultiCurrencyTickerItemConstructorTest()
        {
            MtGoxMultiCurrencyTickerItemDetail high = null;
            MtGoxMultiCurrencyTickerItemDetail low = null;
            MtGoxMultiCurrencyTickerItemDetail avg = null;
            MtGoxMultiCurrencyTickerItemDetail vwap = null;
            MtGoxMultiCurrencyTickerItemDetail vol = null;
            MtGoxMultiCurrencyTickerItemDetail last_all = null;
            MtGoxMultiCurrencyTickerItemDetail last_local = null;
            MtGoxMultiCurrencyTickerItemDetail last = null;
            MtGoxMultiCurrencyTickerItemDetail buy = null;
            MtGoxMultiCurrencyTickerItemDetail sell = null;
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem(high, low, avg, vwap, vol, last_all, last_local, last, buy, sell);
            Assert.AreEqual(target.avg, null);
            Assert.AreEqual(target.buy, null);
            Assert.AreEqual(target.high, null);
            Assert.AreEqual(target.last, null);
            Assert.AreEqual(target.last_all, null);
            Assert.AreEqual(target.last_local, null);
            Assert.AreEqual(target.low, null);
            Assert.AreEqual(target.sell, null);
            Assert.AreEqual(target.vol, null);
            Assert.AreEqual(target.vwap, null);
        }

        /// <summary>
        ///A test for MtGoxMultiCurrencyTickerItem Constructor
        ///</summary>
        [TestMethod()]
        public void MtGoxMultiCurrencyTickerItemConstructorTest1()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            Assert.IsNotNull(target);
        }

        /// <summary>
        ///A test for getObjects
        ///</summary>
        [TestMethod()]
        public void getObjectsTest()
        {
            string jsonDataStr = "{\"high\": {\"value\":\"5.70653\",\"value_int\":\"570653\",\"display\":\"$5.70653\",\"currency\":\"USD\"},\"low\": {\"value\":\"5.4145\",\"value_int\":\"541450\",\"display\":\"$5.41450\",\"currency\":\"USD\"},\"avg\": {\"value\":\"5.561119626\",\"value_int\":\"556112\",\"display\":\"$5.56112\",\"currency\":\"USD\"},\"vwap\": {\"value\":\"5.610480461\",\"value_int\":\"561048\",\"display\":\"$5.61048\",\"currency\":\"USD\"},\"vol\":{\"value\":\"55829.58960346\",\"value_int\":\"5582958960346\",\"display\":\"55,829.58960346\u00a0BTC\",\"currency\":\"BTC\"},\"last_local\":{\"value\":\"5.5594\",\"value_int\":\"555940\",\"display\":\"$5.55940\",\"currency\":\"USD\"},\"last_all\":{\"value\":\"5.5594\",\"value_int\":\"555940\",\"display\":\"$5.55940\",\"currency\":\"USD\"},\"last\":{\"value\":\"5.5594\",\"value_int\":\"555940\",\"display\":\"$5.55940\",\"currency\":\"USD\"},\"buy\":{\"value\":\"5.53587\",\"value_int\":\"553587\",\"display\":\"$5.53587\",\"currency\":\"USD\"},\"sell\":{\"value\":\"5.56031\",\"value_int\":\"556031\",\"display\":\"$5.56031\",\"currency\":\"USD\"}}";
            //  {
            //  "high": {"value":"5.70653","value_int":"570653","display":"$5.70653","currency":"USD"},
            //  "low": {"value":"5.4145","value_int":"541450","display":"$5.41450","currency":"USD"},
            //  "avg": {"value":"5.561119626","value_int":"556112","display":"$5.56112","currency":"USD"},
            //  "vwap": {"value":"5.610480461","value_int":"561048","display":"$5.61048","currency":"USD"},
            //  "vol":
            //  {
            //   "value":"55829.58960346",
            //   "value_int":"5582958960346",
            //   "display":"55,829.58960346\u00a0BTC",
            //   "currency":"BTC"
            //  },
            //  "last_local":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},
            //  "last_all":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},
            //  "last":{"value":"5.5594","value_int":"555940","display":"$5.55940","currency":"USD"},
            //  "buy":{"value":"5.53587","value_int":"553587","display":"$5.53587","currency":"USD"},
            //  "sell":{"value":"5.56031","value_int":"556031","display":"$5.56031","currency":"USD"}
            //  }
            MtGoxMultiCurrencyTickerItem expected = new MtGoxMultiCurrencyTickerItem(new MtGoxMultiCurrencyTickerItemDetail(5.70653,570653,"$5.70653", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.USD),
                new MtGoxMultiCurrencyTickerItemDetail(5.4145,541450,"$5.41450", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.USD),
                new MtGoxMultiCurrencyTickerItemDetail(5.561119626,556112,"$5.56112", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.USD),
                new MtGoxMultiCurrencyTickerItemDetail(5.610480461,561048,"$5.61048", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.USD),
                new MtGoxMultiCurrencyTickerItemDetail(55829.58960346, 5582958960346, "55,829.58960346\u00a0BTC", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.BTC),
                new MtGoxMultiCurrencyTickerItemDetail(5.5594,555940,"$5.55940", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.USD),
                new MtGoxMultiCurrencyTickerItemDetail(5.5594,555940,"$5.55940", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.USD),
                new MtGoxMultiCurrencyTickerItemDetail(5.5594,555940,"$5.55940", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.USD),
                new MtGoxMultiCurrencyTickerItemDetail(5.53587,553587,"$5.53587", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.USD),
                new MtGoxMultiCurrencyTickerItemDetail(5.56031,556031,"$5.56031", Taype.Trading.BTC.MtGoxAPIClient.MtGoxCurrencySymbol.USD)
                );
            MtGoxMultiCurrencyTickerItem actual;
            actual = MtGoxMultiCurrencyTickerItem.getObjects(jsonDataStr);
            Assert.AreEqual(expected.avg.currency, actual.avg.currency);
            Assert.AreEqual(expected.avg.display, actual.avg.display);
            Assert.AreEqual(expected.avg.value, actual.avg.value);
            Assert.AreEqual(expected.avg.value_int, actual.avg.value_int);

            Assert.AreEqual(expected.buy.currency, actual.buy.currency);
            Assert.AreEqual(expected.buy.display, actual.buy.display);
            Assert.AreEqual(expected.buy.value, actual.buy.value);
            Assert.AreEqual(expected.buy.value_int, actual.buy.value_int);

            Assert.AreEqual(expected.high.currency, actual.high.currency);
            Assert.AreEqual(expected.high.display, actual.high.display);
            Assert.AreEqual(expected.high.value, actual.high.value);
            Assert.AreEqual(expected.high.value_int, actual.high.value_int);

            Assert.AreEqual(expected.last.currency, actual.last.currency);
            Assert.AreEqual(expected.last.display, actual.last.display);
            Assert.AreEqual(expected.last.value, actual.last.value);
            Assert.AreEqual(expected.last.value_int, actual.last.value_int);

            Assert.AreEqual(expected.last_all.currency, actual.last_all.currency);
            Assert.AreEqual(expected.last_all.display, actual.last_all.display);
            Assert.AreEqual(expected.last_all.value, actual.last_all.value);
            Assert.AreEqual(expected.last_all.value_int, actual.last_all.value_int);

            Assert.AreEqual(expected.last_local.currency, actual.last_local.currency);
            Assert.AreEqual(expected.last_local.display, actual.last_local.display);
            Assert.AreEqual(expected.last_local.value, actual.last_local.value);
            Assert.AreEqual(expected.last_local.value_int, actual.last_local.value_int);

            Assert.AreEqual(expected.low.currency, actual.low.currency);
            Assert.AreEqual(expected.low.display, actual.low.display);
            Assert.AreEqual(expected.low.value, actual.low.value);
            Assert.AreEqual(expected.low.value_int, actual.low.value_int);

            Assert.AreEqual(expected.sell.currency, actual.sell.currency);
            Assert.AreEqual(expected.sell.display, actual.sell.display);
            Assert.AreEqual(expected.sell.value, actual.sell.value);
            Assert.AreEqual(expected.sell.value_int, actual.sell.value_int);

            Assert.AreEqual(expected.vol.currency, actual.vol.currency);
            Assert.AreEqual(expected.vol.display, actual.vol.display);
            Assert.AreEqual(expected.vol.value, actual.vol.value);
            Assert.AreEqual(expected.vol.value_int, actual.vol.value_int);

            Assert.AreEqual(expected.vwap.currency, actual.vwap.currency);
            Assert.AreEqual(expected.vwap.display, actual.vwap.display);
            Assert.AreEqual(expected.vwap.value, actual.vwap.value);
            Assert.AreEqual(expected.vwap.value_int, actual.vwap.value_int);
        }

        /// <summary>
        ///A test for avg
        ///</summary>
        [TestMethod()]
        public void avgTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            MtGoxMultiCurrencyTickerItemDetail expected = null;
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.avg = expected;
            actual = target.avg;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for buy
        ///</summary>
        [TestMethod()]
        public void buyTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            MtGoxMultiCurrencyTickerItemDetail expected = null; 
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.buy = expected;
            actual = target.buy;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for high
        ///</summary>
        [TestMethod()]
        public void highTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            MtGoxMultiCurrencyTickerItemDetail expected = null;
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.high = expected;
            actual = target.high;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for last
        ///</summary>
        [TestMethod()]
        public void lastTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem(); 
            MtGoxMultiCurrencyTickerItemDetail expected = null; 
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.last = expected;
            actual = target.last;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for last_all
        ///</summary>
        [TestMethod()]
        public void last_allTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            MtGoxMultiCurrencyTickerItemDetail expected = null;
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.last_all = expected;
            actual = target.last_all;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for last_local
        ///</summary>
        [TestMethod()]
        public void last_localTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            MtGoxMultiCurrencyTickerItemDetail expected = null;
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.last_local = expected;
            actual = target.last_local;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for low
        ///</summary>
        [TestMethod()]
        public void lowTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            MtGoxMultiCurrencyTickerItemDetail expected = null;
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.low = expected;
            actual = target.low;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for sell
        ///</summary>
        [TestMethod()]
        public void sellTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            MtGoxMultiCurrencyTickerItemDetail expected = null;
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.sell = expected;
            actual = target.sell;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for vol
        ///</summary>
        [TestMethod()]
        public void volTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            MtGoxMultiCurrencyTickerItemDetail expected = null;
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.vol = expected;
            actual = target.vol;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for vwap
        ///</summary>
        [TestMethod()]
        public void vwapTest()
        {
            MtGoxMultiCurrencyTickerItem target = new MtGoxMultiCurrencyTickerItem();
            MtGoxMultiCurrencyTickerItemDetail expected = null;
            MtGoxMultiCurrencyTickerItemDetail actual;
            target.vwap = expected;
            actual = target.vwap;
            Assert.AreEqual(expected, actual);
        }
    }
}
